package com.liujit.upms.mapper;

import com.liujit.upms.domain.model.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description 系统用户Mapper
 * @Author liujun
 * @Date 2021-07-02 15:01:25
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    /**
     * 根据用户id，查询角色名称
     *
     * @param userId
     * @return
     * @author: liujun
     * @date: 2021/7/7 5:38 下午
     */
    @Select("select sr.`name` from sys_user_role sur inner join sys_role sr on sr.id = sur.role_id where sur.user_id = #{userId}")
    List<String> selRoleNameByUserId(Long userId);
}